<?php
if(!empty($_POST) && isset($_POST['Save']))
{
	$date = @date("Y.m.d H.i.s");
	$con = Connect();
	mysql_query("UPDATE notes SET Title='".$_POST['Title']."', Text='".$_POST['Text']."', Timestamp='$date' WHERE ID='".$_SESSION['ID']."' AND Entry='".$_POST['n_entry']."'");
	Close($con);
}
$entry = $_GET['Entry'];
$con = Connect();
$result = mysql_fetch_assoc(mysql_query("SELECT * FROM notes WHERE ID='".$_SESSION['ID']."' AND Entry='$entry'"));
Close($con);
?>
<form method="POST">
	<table class="Message">
		<tr>
			<th>Title: </th><th><input type="text" name="Title" value="<?php echo $result['Title']; ?>"></th>
		</tr>
		<tr>
			<th>Text: </th><th><input type="text" name="Text" value="<?php echo $result['Text']; ?>"></th>
		</tr>
		<tr>
			<th style="visibility:hidden"><input type="hidden" name="n_entry" value="<?php echo $result['Entry']; ?>"></th><th><input type="submit" name="Save" value="Speichern"></th>
		</tr>
	</table>
</form>